import request from "@/utils/request";
// 获取所有小区信息
export function getCommunityListApi(params) {
  return request({
    url: "/community",
    params,
  });
}
// 添加小区
export const addommunityApi = (data) => {
  return request.post("/community", data);
};
// 获取小区详细信息--编辑
export function getCommunityDeatilApi(id) {
  return request({
    url: `/community/` + id,
  });
}
// 修改小区

export function editCommunityDeatilApi(data) {
  return request({
    url: `/community/${data.id}`,
    method: "PUT",
    data,
  });
}
// 删除小区
export function delCommunityDeatilApi(id) {
  return request({
    url: `/community/${id}`,
    method: "delete",
  });
}
// 搜索
export function SearchCommunityListApi(params) {
  return request({
    url: "/community",
    params,
  });
}
// 上传图片
export const upImage = (data) => {
  return request.post("/base/upload?field=community", data);
};
